/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/layout'

const ScmRouter = {
  path: '/scm',
  component: Layout,
  redirect: '/scm/sale-management/sale-order',
  name: 'Scm',
  meta: {
    title: 'Scm',
    icon: 'nested'
  },
  alwaysShow: true,
  children: [
    {
      alwaysShow: true,
      path: 'sale-management',
      component: () => import('@/views/scm/sale-management/index'), // Parent router-view
      name: 'Sale-management',
      meta: { title: '销售管理' },
      redirect: '/scm/sale-management/sale-order',
      children: [
        {
          path: 'sale-order',
          component: () => import('@/views/scm/sale-management/sale-order/index'),
          name: 'Sale-order',
          meta: { title: '销售订单' }
        },
        // {
        //   path: 'sale-contract',
        //   component: () => import('@/views/scm/sale-management/sale-contract/index'),
        //   name: 'Sale-Contract',
        //   meta: { title: '销售合同' }
        // },
        {
          path: 'sale-contract2',
          component: () => import('@/views/scm/sale-management/sale-contract2/index'),
          name: 'Sale-Contract2',
          meta: { title: '销售合同' }
        },
        {
          path: 'sale-delivery',
          component: () => import('@/views/scm/sale-management/sale-delivery/index'),
          name: 'Sale-Delivery',
          meta: { title: '销售发货' }
        },
        {
          path: 'sale-return',
          component: () => import('@/views/scm/sale-management/sale-return/index'),
          name: 'Sale-Return',
          meta: { title: '销售退货' }
        },
      ]
    },
    {
      alwaysShow: true,
      path: 'sale-report',
      component: () => import('@/views/scm/sale-report/index'), // Parent router-view
      name: 'Sale-Report',
      meta: { title: '销售报表' },
      redirect: '/scm/sale-report/sale-ledger',
      children: [
        {
          path: 'sale-ledger',
          component: () => import('@/views/scm/sale-report/sale-ledger/index'),
          name: 'Sale-Ledger',
          meta: { title: '销售台账' }
        },
      ]
    },
  ]
}

export default ScmRouter
